package com.woniu.new_orange.personnel_model_wu.controller;

import com.woniu.new_orange.entity.User;
import com.woniu.new_orange.entity.Vip;
import com.woniu.new_orange.personnel_model_wu.VO.VipVo;
import com.woniu.new_orange.personnel_model_wu.service.UserService;
import com.woniu.new_orange.personnel_model_wu.service.VipService;
import com.woniu.new_orange.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Program: new_orange->VipController
 * @Description:
 * @Author: 13488
 * @Date: 2023-02-02 19:01
 * @Version： 1.0
 **/
@RestController
@RequestMapping("/vips")
@Api(tags = "会员")
public class VipController {
    @Autowired
    private VipService vipService;
//查询vip信息 -吴
@ApiOperation(value = "/通过userid查询vip信息")
    @GetMapping("{id}")

@ApiResponses({
        @ApiResponse(code = 401,message = "未认证"),
        @ApiResponse(code = 403,message = "无权访问"),
        @ApiResponse(code = 404,message = "未找到")
})
    public Result getOne(@PathVariable("") long id){
        VipVo vipVo = vipService.selectByUserId(id);
        return Result.ok().data("vipvo",vipVo);
    }
}
